package com.ztil.log;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class LogUtils {

	public static void log(String msg, String path) {
		File file = new File(path);
		if (!file.exists()) {
			File pPath = file.getAbsoluteFile().getParentFile();
			if (!pPath.exists()) {
				pPath.mkdirs();
			}
			try {
				file.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		try (FileWriter pw = new FileWriter(file, true)) {
			pw.write(msg + "\r\n");
			pw.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
